package demo.oslutschyk;

import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 */
public class JdbcManager {
    private static Statement statement;
    public static  Statement getStatement() throws ClassNotFoundException, SQLException {
        if (statement == null) {
            //todo load from properties
            Class.forName("org.apache.derby.jdbc.ClientDriver");
            Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/PersonDB;user=app;password=app");
            statement = con.createStatement();
        }
        return statement;
    }
}
